package com.xmler.plugin.adbrocket.adb.command

import com.android.ddmlib.IDevice
import com.intellij.openapi.project.Project
import org.jetbrains.android.facet.AndroidFacet
import javax.swing.JTextArea

open class CommandList(vararg cmds: ICommand): ICommand {
    private val cmdList = listOf(*cmds)
    override fun run(
        project: Project,
        device: IDevice,
        facet: AndroidFacet,
        packageName: String,
        display: JTextArea
    ): Boolean {
        for (cmd in cmdList) {
            if (!cmd.run(project, device, facet, packageName, display)) {
                return false
            }
        }
        return true
    }
}